package model;

import java.sql.Timestamp;

/**
 * 用户实体类
 */
public class User {
    private String userId;
    private String username;
    private String name;
    private int role;           // 0-学生，1-社团负责人，2-管理员
    private Timestamp createTime;

    // 构造方法
    public User() {}

    public User(String userId, String username, String name, int role) {
        this.userId = userId;
        this.username = username;
        this.name = name;
        this.role = role;
        this.createTime = new Timestamp(System.currentTimeMillis());
    }

    // Getters and Setters
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public int getRole() { return role; }
    public void setRole(int role) { this.role = role; }

    public Timestamp getCreateTime() { return createTime; }
    public void setCreateTime(Timestamp createTime) { this.createTime = createTime; }

    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", username='" + username + '\'' +
                ", name='" + name + '\'' +
                ", role=" + role +
                ", createTime=" + createTime +
                '}';
    }
}